package com.share.hope.controller;

import com.share.hope.entity.CommentInfo;
import com.share.hope.entity.result.R;
import com.share.hope.service.CommentInfoService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/share/hope/comment")
@RequiredArgsConstructor
@Slf4j
@Tag(name = "评论管理接口")
@CrossOrigin
public class CommentController {

    private final CommentInfoService commentInfoService;

    @PostMapping("/create")
    R<String> createComment(@RequestBody CommentInfo commentInfo) {
        return commentInfoService.createComment(commentInfo);
    }

    @GetMapping("/delete")
    R<String> deleteComment(@RequestParam Long id) {
        return commentInfoService.deleteComment(id);
    }

}
